﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ascx_Reservatie : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    public delegate void DateSelectedHandler(DateTime dtDateSelected);
    public event DateSelectedHandler DateSelected;

    #region Events
    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        if (DateSelected != null)
            DateSelected(Calendar1.SelectedDate);
        this.Panel1_ModalPopupExtender.Show();
    }
    protected void Calendar1_VisibleMonthChanged(object sender, MonthChangedEventArgs e)
    {
        this.Panel1_ModalPopupExtender.Show();
    }

    protected void btnCloseMsg_Click(object sender, ImageClickEventArgs e)
    {
        Panel1_ModalPopupExtender.Hide();
    }
    #endregion

    #region Methods
    public void Show()
    {
        this.Panel1_ModalPopupExtender.Show();

        this.txtStartdate.Text = this.startDate.ToShortDateString();
        this.txtdagDeel.Text = this.dagDeel;
    }
    #endregion

    #region Properties

    public DateTime startDate
    {
        get
        {
            if (ViewState["startDate"] != null)
            {
                return (DateTime)ViewState["startDate"];
            }
            else
            {
                return DateTime.MinValue;
            }
        }

        set
        {
            ViewState["startDate"] = value;
        }


    }

    public string dagDeel
    {

        get
        {
            if (ViewState["dagDeel"] != null)
            {
                return (string)ViewState["dagDeel"];
            }
            else
            {
                return string.Empty;
            }
        }

        set
        {
            ViewState["dagDeel"] = value;
        }
    }

    #endregion



}
